package main

import (
	"bytes"
	"errors"
	"fmt"
)

func A(v int) func() int  {
	return func() int{
		v++
		return v
	}
}
func join_all(sli ...string) string{
	var b bytes.Buffer
	for _,s := range sli{
		b.WriteString(s)
	}
	return b.String()
}
func fi(sli ...interface{})  {
	for _,i :=range sli{
		fmt.Println(i)
	}

}
func print(sli ...interface{}){

	fi("suv",sli)
}
func main()  {
	a :=A(1)
	b:=interface{}(10)
	fmt.Println(a())
	defer fmt.Println(join_all("dsvnjkvd","dvcbhjdv","scb vfh"))//延迟执行
	switch b.(type) {
	case bool:
		fmt.Println("bool")
	default:
		fmt.Printf("%T",b)
	}

    print("vidosj","dsvjikl")
	e :=errors.New("ecmkdsjfvc")
	fmt.Println(e.Error())
	var esa es
	esa = &ds{"sdvj",1}
	print(esa.ess(),ds{"sdssvj",1}.s)
}

type ds struct {
	s string
	i int
}
type es interface {
	ess() string
}

func (e *ds) ess() string {
	return e.s
}